﻿package com.dykj.platform.framework.dao.support;

import java.io.Serializable;

/**
 * @Title: DYKJ Platform
 * @Description: 排序
 * @Copyright: Copyright (c) 2008
 * @Company: DYKJ
 * @author jit@dykj.cn
 * @version 1.0
 */
public class Sort implements Serializable {

	private static final long serialVersionUID = -664677683970296287L;

	public static final String DESC = "desc";

	public static final String ASC = "asc";

	protected String property;

	protected String alias;

	protected String sortOrder;

	public Sort() {
		property = null;
		alias = null;
		sortOrder = null;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public String getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(String sortOrder) {
		this.sortOrder = sortOrder;
	}

	public String toString() {
		StringBuffer buffer = new StringBuffer("");
		if (property != null) {
			buffer.append(" order by ");
			buffer.append(property);
			buffer.append(" ");
			if (sortOrder == null)
				buffer.append("asc");
			else
				buffer.append(sortOrder);
		}
		return buffer.toString();
	}

}
